/*******************************************************************************
 * Copyright (c) 2002, 2003 Boris Pruessmann and others. All rights reserved.
 * This program and the accompanying materials are made available under the
 * terms of the Common Public License v0.5 which accompanies this distribution,
 * and is available at http://www.eclipse.org/legal/cpl-v05.html
 * 
 * Contributors: Boris Pruessmann - Initial implementation. Boris Pruessmann -
 * Added getFileType.
 ******************************************************************************/
package net.sourceforge.perforce.core.resources;

import net.sourceforge.perforce.core.api.IFileType;
import net.sourceforge.perforce.core.api.IPerforceServer;

import org.eclipse.core.runtime.IPath;

/**
 * @version $Revision: 488 $
 * @author <a href="mailto:bpruessmann@users.sourceforge.net">Boris
 *         Pruessmann</a>
 */
public interface IP4File {
  // ---------------------------------------------------------------------------
  // Predicate Methods

  /**
   * Indicates whether the file is resolved or not.
   * 
   * @return true or false.
   */
  boolean isResolved();

  /**
   * Indicates whether the file needs resolving or not.
   * 
   * @return true or false.
   */
  boolean needsResolve();

  /**
   * Indicates whether the file is locked by us
   * 
   * @return true or false.
   */
  boolean hasOurLock();

  //----------------------------------------------------------------------------
  // --------- Methods

  /**
   * Returns the changelist id.
   * 
   * @return id of the changelist.
   */
  Integer getChangelistId();

  /**
   * Called to retrieve the name of the file.
   * 
   * @return the file name.
   */
  String getName();

  /**
   * Retrieves the complete depot path of the file.
   * 
   * @return the depot path.
   */
  String getDepotFilename();

  /**
   * Returns the complete local filename.
   * 
   * @return the local file name.
   */
  IPath getLocation();

  /**
   * Retrieves the 'have' revision of the file.
   * 
   * @return the file's have revision.
   */
  Integer getRevision();

  /**
   * Returns the current action that is performed on the file.
   * 
   * @return the current action.
   */
  String getAction();

  /**
   * Returns the file's file type.
   * 
   * @return the file type.
   */
  IFileType getFileType();

  /**
   * Returns the client name.
   * 
   * @return the client name.
   */
  String getClientName();

  /**
   * Returns the server to which the file belongs.
   * 
   * @return the server.
   */
  IPerforceServer getServer();
}
